<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Skim</title> 
<style>
#header {
	background-color:black;
	color:white;
	text-align:center;
    padding:1px;}
#navs {
	background-color:#eeeeee;
	height:800px;
	width:380px;
	float:left;
	text-align:center;
	padding:5px;
}
#navf {
	background-color:#eeeeee;
	height:800px;
	width:380px;
	float:left;
	text-align:center;
	padding:5px;
}
#foot {
	background-color:black;
	color:white;
	text-align:center;
    padding:20px;
	clear:both;
}
#body {
	background-color:yellow;
	color:black;
	text-align:center;
	height:810px;
	width:513px;
	float:left;
}
</style>
</head>
<body>
<div id="header"><h1>查看</h1></div>
<div id="navf"><b style="color:red">熊<br>猫<br>博<br>客<br></b><b>正<br>在<br>为<br>您<br>服<br>务<br>！</b></div>
<div id="body">
<p>
<?php 
session_start();
include_once("../class/mysqlclass.php");
$id=$_GET['id'];
$pages=$_GET['page'];
$pdo =new my();
$res =$pdo->SelectId($id);
foreach($res as $var){
	echo '<br>标题：'.$var['title'];
	echo '<br>作者：'.$var['author'];
	echo '<br>简介：'.$var['description'];
	//主体内容进行页码分页
	echo '<br>内容：'.$pdo->Page($var['content'],$pages,994).'<br>';
	$num=mb_strlen($var["content"]);
	if($num%994!=0){
		$num=($num-$num%994)/994+1;
	}else{
		$num= $num/994;
	}
	for($i=1;$i<=$num;$i++){
		echo '<a href="skim.php?id='.$id.'&page='.$i.'">'.$i.'</a>';
		echo ' ';
	}
}
//作者有权删改
if($var['author']==$_SESSION['ath']){ 
	echo '<p style="text-align:right"><a href="./modify.php?id='.$_GET['id'].'">修改</a>|';
	echo '<a href="./xiugai.php?id=wz'.$_GET['id'].'">删除</a></p>';
 } ?>
</p >
</div>
<div id="navs">
	<b style="color:red">熊<br>猫<br>博<br>客<br></b><b>正<br>在<br>为<br>您<br>服<br>务<br>！</b>
</div>
<div id="foot">
	<a href="./show.php?id=1">返回文章展示</a><br><a href="../html/select.html">返回文章搜查</a>
</div>
</body>

